#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

#if 0
    QStackedWidget* stackedWidget = new QStackedWidget(this);

    QTextEdit* textEdit1 = new QTextEdit("111",stackedWidget);
    QTextEdit* textEdit2 = new QTextEdit("222",stackedWidget);
    QTextEdit* textEdit3 = new QTextEdit("333",stackedWidget);
    QTextEdit* textEdit4 = new QTextEdit("444",stackedWidget);

    stackedWidget->addWidget(textEdit1);
    stackedWidget->addWidget(textEdit2);
    stackedWidget->addWidget(textEdit3);
    stackedWidget->addWidget(textEdit4);

    QComboBox* comboBox = new QComboBox(stackedWidget);

    comboBox->addItem("1",1);
    comboBox->addItem("2",2);
    comboBox->addItem("3",3);
    comboBox->addItem("4",4);

    QVBoxLayout* vBoxLayout_main = new QVBoxLayout(this);
    vBoxLayout_main->addWidget(stackedWidget);
    vBoxLayout_main->addWidget(comboBox);

    connect(comboBox, SIGNAL(currentIndexChanged(int)), stackedWidget, SLOT(setCurrentIndex(int)));
#endif
    connect(ui->comboBox, SIGNAL(currentIndexChanged(int)), ui->stackedWidget, SLOT(setCurrentIndex(int)));
}

Widget::~Widget()
{
    delete ui;
}
